package com.mcxx.modules;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;


@Data
public class BaseParam implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "地区码")
    private String areaCode;
    @ApiModelProperty(value = "用户办理地区，分隔符','")
    private String userAreas;
    @ApiModelProperty(value = "业务类型110低保130特困")
    private String businessType;
    @ApiModelProperty(value = "当前用户行政级别")
    private Integer userLevel = 5;
    @ApiModelProperty(value = "机构id")
    private String orgId;


    public static <T> List<T> string2List(String str) {
        if (StringUtils.isEmpty(str)) {
            return new ArrayList();
        } else {
            str = str.replace('，', ',');
            return (List) Arrays.stream(str.split(",")).collect(Collectors.toList());
        }
    }
}
